
function promptInformation(dom, level, msg,id) {
	var idhtml="";
	if(id!=null&&id!=""){
		
		idhtml='id="'+id+'"';
	}
	var alertmsg;
	var success="成功";
	var error = "错误";
	var warning = "警告";
	var info = "信息";

	var i18n= getCookie("org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE");
	 
	if(i18n=="en_US"){
		 success="Success";
		 error = "Error";
		 warning = "Warning";
		 info = "Info";
	}
	 
	if (level == '0') {
		alertmsg = '<div class="alert alert-success" '+idhtml+'>'
				+ '<a href="#" class="close" data-dismiss="alert">&times;</a>'
				+ '<strong>'+success+'！</strong>' + msg + '</div>';
	} else if (level == '1') {
		alertmsg = '<div class="alert alert-warning" '+idhtml+'>'
				+ '<a href="#" class="close" data-dismiss="alert">&times;</a>'
				+ '<strong>'+warning+'！</strong>' + msg + '</div>';
	} else if (level == '2') {
		alertmsg = '<div class="alert alert-danger" '+idhtml+'>'
				+ '<a href="#" class="close" data-dismiss="alert">&times;</a>'
				+ '<strong>'+error+'！</strong>' + msg + '</div>';
	} else {
		alertmsg = '<div class="alert alert-info" '+idhtml+'>'
				+ '<a href="#" class="close" data-dismiss="alert" >&times;</a>'
				+ '<strong>'+info+'！</strong>' + msg + '</div>';
	}
	dom.append(alertmsg);
}

function promptError(dom, XMLHttpRequest, textStatus,id) {
	
	var val1 = "请求超时";
	var val2 = "内部读取数据错误，请联系管理员"
		
	var i18n= getCookie("org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE");
	
	if(i18n=="en_US"){
		val1="timeout"
		val2="The internal read data error, please contact the administrator";
	}
	
	if (textStatus == 'timeout') {
		promptInformation(dom, 1, val1,id);
	} else if (XMLHttpRequest.status == 500) {
		promptInformation(dom, 2, val2,id);
	}
}